var netTool
var apiPath = 'capi/V2/FFAreaPrice/ffAreaPrice/'

function AreaPrice(_netTool) {
	netTool = _netTool

	this.list = function(data, fn) {
		netTool.getAjaxUrlValueBackground(apiPath + 'list', {
			id: uni.getStorageSync("userInfoArea"),
			...data
		}, function(res) {
			wx.setStorageSync("userArea", res.rows)
			console.log("userArea",res.rows)
			typeof fn == 'function' && fn(res);
		})
	}

	this.update = function(data, fn) {
		netTool.getAjaxUrlValueBackground(apiPath + 'update', {
			...data,
		}, function(res) {
			typeof fn == 'function' && fn(res);
		})
	}
	this.save = function(data, fn) {
		netTool.getAjaxUrlValueBackground(apiPath + 'save', {
			...data,
		}, function(res) {
			typeof fn == 'function' && fn(res);
		})
	}

}
module.exports = AreaPrice;
